package com.kaibes.core.base.proxy;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public interface ProxyInvokeListener {
    
    boolean beforeInvoke(Object proxy, Method method, Object[] args);

    default Object doInvoke(Method method, Object target, Object... args)
            throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        return method.invoke(target, args);
    }

    default Object afterInvoke(Object result) {
        return result;
    }

}
